package com.lxg;

import com.lxg.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 陆小根
 * date: 2022/04/23
 * Description:
 */

public class App {

  public static void main(String[] args) {
    // 3.获取IoC容器
    ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    // 4.获取bean
//    BookDao bookDao = (BookDao) context.getBean("bookDao");
//    bookDao.save();

    BookService bookService = (BookService) context.getBean("bookService");
    bookService.save();

  }

}
